﻿using System;
using System.Collections.Generic;
using System.Text;
using ECCSystem.EntityClass;

namespace ECCSystem.BizRule
{ 
    class ClsTrackTaskBill
    {
		DataAccess.ClsTrackTaskBill objDAMC = new ECCSystem.DataAccess.ClsTrackTaskBill();
		public ClsTrackTaskBill()
        { }
        //Get all MailCategory records list
		public object GetList(int intUserID, int intStatus, DateTime dtTime, int intFlg)
        {
			return objDAMC.GetTrackTaskBill(intUserID, intStatus, SetStartDate(dtTime), SetEndDate(dtTime), intFlg);
        }


		public object GetSysInfor()
		{
			return objDAMC.GetSysInfor();
		}

		public void AddTrackTaskBill(TrackTaskBillEntity objTrackTaskBillEntity)
        {
			objDAMC.AddTrackTaskBill(objTrackTaskBillEntity);

        }
        public void DeleteTrackTaskBill(string strID)
        {
			objDAMC.DeleteTrackTaskBill(strID);
        }

		public void UpdateTrackTaskBill(TrackTaskBillEntity objTrackTaskBillEntity)
		{
			objDAMC.UpdateTrackTaskBill(objTrackTaskBillEntity);
		}

		public void SubmitTrackTaskBill(TrackTaskBillEntity objTrackTaskBillEntity)
		{
			objDAMC.SubmitTrackTaskBill(objTrackTaskBillEntity);
		}

		public void AddMailCheck(int intUserID, DateTime dtStart, DateTime dtEnd ,string strKeyID)
		{
			objDAMC.AddMailCheck(intUserID, dtStart, dtEnd, strKeyID);
		}

		public void UpdateMailCheck(int intUserID, DateTime dtStart, DateTime dtEnd, string strKeyID)
		{
			objDAMC.UpdateMailCheck(intUserID, dtStart, dtEnd, strKeyID);
		}

		private DateTime SetStartDate(DateTime dtDateTime)
		{
			string strTime;
			string strDate;
			strTime = ClsCommon.gStrStart;
			strDate = dtDateTime.ToLongDateString();

			return Convert.ToDateTime(strDate + " " + strTime);
		}

		private DateTime SetEndDate(DateTime dtDateTime)
		{
			string strTime;
			string strDate;
			strTime = ClsCommon.gStrEnd;
			strDate = dtDateTime.AddDays(1).ToLongDateString();

			return Convert.ToDateTime(strDate + " " + strTime);
		}
    }
}
